# 人工从euph里面分离出确定是毒品名称的词语,只要出现就一定是毒品名称
drug_names = ['thc', 'xtc', 'ecstasy', 'morphine', 'benzos', 'methylphenidate', 'cbd', 'promethazine', 'suboxone',
              'maui_wowie', 'xanies', 'percocet', 'shwag', 'bhang', 'heroin', 'hydrocodone', 'thca', 'flunitrazepam',
              'opium', 'psilocybin_mushrooms', 'marijuana', 'cbd_oil', 'weed', 'cocaine', 'crack_cocaine', 'ditch_weed',
              'mescaline', 'cannabis', 'edibles', 'bho', 'terpenes', 'synthetic_cathinones', 'shrooms', 'pcp',
              'methamphetamine', 'hydromorphone', 'oxycodone', 'animal_tranquilizer', 'black_tar', 'ghb', 'menthol',
              'clonazepam', 'sour_og', 'amphetamine', 'sizzurp', 'pingers', 'alprazolam', 'lsd', 'ketamine',
              'marijuana_concentrates', 'steroids', 'adderall', 'xanax', 'drug', 'mdma']

# 去除重复的词语，确保小class和毒品名称不会混淆
drug_euphs = ['addy', 'bars', 'bricks', 'white_boys', 'blacks', 'brownies', 'chocolates', 'christina',
              'dexies', 'diet_pills', 'peaches', 'pepper', 'zoomers', 'animals', 'baby_powder', 'beach',
              'blast', 'cars', 'coca', 'coca-cola', 'coconut', 'coke', 'colorado', 'dream', 'fish', 'fish_scale',
              'flake', 'fox', 'galaxy', 'gin', 'guitar', 'hamburger', 'heaven', 'hunter', 'jam', 'lady', 'material',
              'milk', 'peruvian', 'pimp', 'poli', 'scorpion', 'seed', 'sneeze', 'sniff', 'snow_white', 'teenager',
              'tequila', 'toyota', 't-shirts', 'turkey', 'white_powder', 'yayo', 'baseball', 'bone', 'boulder', 'cd',
              'climax', 'cookies', 'freebase', 'french_fries', 'golf_ball', 'ice_cubes', 'issues', 'johnson',
              'kryptonite', 'pebbles', 'quarters', 'rock', 'slab', 'tension', 'tissue', 'adam', 'blue_superman',
              'bombs', 'clarity', 'doctor', 'e', 'eve', 'hug', 'peace', 'rolls', 'rolling', 'vitamin_e', 'x', 'chinese',
              'facebook', 'fent', 'lollipop', 'pharmacy', 'roach', 'everclear', 'g', 'goop', 'soap', 'antifreeze',
              'ballot', 'basketball', 'big_bag', 'brown', 'brown_crystal', 'brown_sugar', 'burrito', 'cardio', 'coco',
              'dirt', 'dog_food', 'dope', 'downtown', 'engines', 'goat', 'h', 'hard_candy', 'harry', 'horse', 'mud',
              'obama', 'pants', 'poppy', 'puppy', 'pure', 'sack', 'sand', 'shirts', 'skag', 'smack', 'tan', 'tar',
              'tootsie_roll', 'turtle', 'whiskey', 'white_boy', 'dones', 'fluff', 'hydros', 'vics', 'vikes', 'dillies',
              'donkey', 'jet', 'kit_kat', 'kitty_flip', 'special_k', 'vitamin_k', 'wonky', 'khat', 'acid',
              'battery_acid', 'blotter_acid', 'cid', 'crackers', 'cupcakes', 'dots', 'fields', 'goofy', 'haze',
              'heavenly_blue', 'kaleidoscope', 'leary', 'lucy', 'newspapers', 'owsley', 'pellets', 'pizza', 'pop',
              'sacrament', 'sandoz', 'sugar_cubes', 'white_fluff', 'zen', '420', 'arizona', 'ashes', 'baby',
              'blue_dream', 'blue_jeans', 'blueberry', 'boo', 'branches', 'broccoli', 'bud', 'catnip', 'cheeba',
              'chronic', 'cigars', 'dank', 'dew', 'doobie', 'flower', 'fluffy', 'gangster', 'ganja', 'ghana', 'gorilla',
              'grass', 'green_crack', 'greenhouse', 'gummy_bears', 'hash', 'hawaiian', 'hay', 'hemp', 'herb',
              'homegrown', 'hydro', 'jane', 'killa', 'mary_jane', 'method', 'mmj', 'mother', 'northern_lights', 'nug',
              'og', 'panama_gold', 'parsley', 'plant', 'popcorn', 'pot', 'puff', 'reefer', 'reggie', 'sativa', 'shrimp',
              'skywalker', 'spliff', 'sticky', 'top_shelf', 'wheat', 'yellow_submarine', 'young_girls', 'bubble_hash',
              'budder', 'crystalline', 'crumble', 'dabs', 'ear_wax', 'errl', 'extract', 'full_melt', 'heady',
              'moon_rocks', 'rosin', 'sap', 'sauce', 'wax', 'blue_caps', 'cactus', 'mescal', 'san_pedro', 'beers',
              'bottles', 'bud_light', 'chicken', 'chris', 'crank', 'cream', 'crystal', 'diamond', 'fizz', 'flowers',
              'fruit', 'garbage', 'girls', 'glass', 'ice_water', 'lemons', 'shabu', 'shards', 'stuff', 'tina', 'trash',
              'truck', 'tupperware', 'yaba', 'diet_coke', 'johnny', 'mph', 'pineapple', 'monkey', 'dreams', 'gee',
              'incense', 'toys', 'cotton', 'greens', 'oc', 'oxy', 'oxy_80s', 'roxy', 'angel_dust',
              'embalming_fluid', 'flakes', 'green_tea', 'sheets', 'spores', 'stp', 'blueberries', 'percs', 'drank',
              'lean', 'purple_drank', 'syrup', 'blue_meanies', 'boomers', 'cubes', 'liberty_caps', 'mushies',
              'silly_putty', 'gear', 'roids', 'boxes', 'bubbles', 'ivory_wave', 'm-cat', 'plant_food', 'scarface']

emerging_euph = {
    # alprazolam
    "bars": [1305860, 688936, 842032, 1272562, 1370948, 1229779, 292027, 429458, 516477, 1354318, 401736, 1047012,
             245619, 1153123, 54659, 355580, 823031, 788847, 1322017, 1280566],
    # amphetamine
    "brownies": [476105, 743812, 716786, 1139873, 939887, 1034411, 447179, 647210, 1261779, 245809, 775399, 1274218,
                 1256205, 1281277, 850463, 993506, 801831, 1374824, 742204, 1373686],
    # cocaine
    "turkey": [881455, 1259512, 1012337, 68825, 289557, 920906, 921958, 1291593, 1335002, 1074341, 708727, 868425,
               1270812, 1116880, 1074243, 754338, 809749, 1357730, 1338054, 177746],
    # crack_cocaine
    # "pebbles":[1176672, 583357, 439702, 736883, 148787, 807967, ],
    # "kryptonite": [1041621, 583427, 1155959, 1244341, 747353, 646337, 974887, 1372162, 183016, 341444, 847811, 1145335,
    #                294114],
    # "ice_cubes": [581351, 1344103, ],
    # "french_fries": [],  # 0

    # ecstasy
    "clarity": [243807, 1078614, 1185426, 808480, 1193360, 1265230, 884602, 201074, 1002315, 1074416, 1058354, 1183733,
                957970, 519590, 508978, 502883, 662825, 427750, 162280, 24962],
    # ghb
    "g": [891880, 1020084, 1223832, 114776, 757669, 610545, 1056306, 1186956, 559783, 1210454, 923776, 1261857, 911284,
          916336, 996433, 999872, 1174905, 542753, 919474, 527173, ],

    # heroin
    "brown_crystal": [636851, 631017, 380863, 1275401, 1252435, 248016, 1095036, 655435, 319672, 92359, 370086, 514181,
                      452372, 913150, 999625, 465220, 316742, 780625, 763057, 973272, ],
    # hydrocodone
    "vikes": [854574, 660906, 379516, 870596, 363298, 423292, 1104768, 1266412, 941722, 982918, 199485, 932553, 700703,
              1301544, 1053909, 1062705, 1302714, 803516, 318568, 870596],
    # ketamine
    "special_k": [807302, 643194, 161880, 945856, 1043817, 957802, 487631, 1013110, 1203807, 483219, 926201, 251820,
                  1176039, 1232578, 1159764, 1197281, 1171530, 875905, 727801, 971545],
    # lsd
    "battery_acid": [1073608, 1167785, 1218120, 1283497, 953085, 1337720, 347244, 587483, 495735, 495573, 702890,
                     910967, 505986, 904919, 779685, 813308, 987616, 1274209, 1001656, 286671],
    # marijuana
    "nug": [1243643, 464133, 1216673, 961160, 1340815, 1066198, 1284419, 1159998, 760929, 951209, 578688, 626056,
            1381190, 1303808, 1389612, 294214, 1344333, 1201907, 989817, 605252],
    ## marijuana_concentrates
    "full_melt": [1189347, 1274234, 519948, 1189347, 1322219, 994816, 325660, 441969, 1173580, 672572, 711267, 231958,
                  1177850, 910211, 711267, 1348581, 793733, 829112, 703387, 1055888, ],
    # mescaline
    "mescal": [1268852, 1221329, 1084128, 236548, 795661, 1084128, 624527, 1021364, 601728, 618529, 203114, 624527,
               148971, 848734, 1186472, 456879, 601728, 1180513, 1196516, 660254],
    # methamphetamine
    "crank": [103515, 140436, 155576, 1276792, 308260, 1197335, 995912, 195885, 502955, 284380, 1276527, 1173188, 94548,
              1244830, 179079, 235613, 1151672, 760299, 1332312, 1005469],
    # methylphenidate
    "mph": [1096206, 942226, 1364449, 398715, 46062, 1046113, 501291, 839296, 336434, 1197514, 1168655, 1377179,
            539432, 762128, 166316, 156893, 890858, 492636, 117217, 1209593],
    # opium
    "incense": [625930, 322204, 310165, 62866, 140675, 1390086, 970663, 398132, 236953, 888031, 162533, 186994,
                545366, 156548, 853594, 666625, 1354983, 899008, 781495, 53688],
    # oxycodone
    "oxy": [760092, 1161400, 1160279, 900614, 870641, 849133, 662130, 256149, 21877, 910431, 821448, 987073, 700588,
            488265, 63531, 35854, 560931, 1335145, 1131553, 166554],
    ## pcp #
    "angel_dust": [261465, 154181, 1367159, 1028604, 363766, 1259180, 364713, 906900, 840110, 1251439, 603610, 610029,
                   1380076, 280085, 591008, 587531, 985593, 67751, 87410, 1234912],
    # percocet
    "percs": [633198, 370491, 187869, 821, 1355338, 1144166, 1180172, 135938, 999357, 1193506, 1382453, 556682, 244976,
              967449, 260125, 556871, 189749, 62406, 713887, 1068548],
    ## promethazine #
    "purple_drank": [980601, 612220, 1007651, 209620, 1116426, 1320623, 677579, 1249376, 602322, 353707, 602900,
                     1249376, 293253, 1349735, 63898, 604676, 848399, 341160, 941722, 143186],
    # psilocybin_mushrooms
    "boomers": [884676, 709461, 1077681, 774392, 380306, 766978, 1149157, 1334451, 293043, 1341931, 259368, 368016,
                748855, 1217032, 1234459, 820487, 1013835, 478539, 271221, 638786],
    # steroids
    "roids": [1159859, 1364071, 1051127, 1363226, 71210, 985262, 259139, 904838, 1270869, 1051127, 1084899, 1333751,
              848656, 855099, 1110570, 908259, 312151, 1363226, 963345, 25586],
    # synthetic_cathinones
    "plant_food": [935500, 935500, 899356, 574606, 1034581, 1172633, 1177375, 1227026, 1326710, 1101332, 603770,
                   1107118, 1299524, 1341416, 903326, 53710, 549876, 335441, 821172, 989376],
}

stopwords = ['a', 'about', 'above', 'across', 'actually', 'after', 'ago', 'aka', 'all', 'alone', 'along', 'almost',
             'also', 'although', 'already', 'around', 'across', 'above', 'ahead', 'anymore',
             'always', 'am', 'an', 'and', 'any', 'anyway', 'anything', 'anyone', 'anyways', 'are', 'as', 'as_long_as',
             'aside', 'at', 'back', 'bad',
             'be', 'being', 'been', 'better', 'before', 'beside', 'besides', 'because', 'best', 'between', 'both',
             'but', 'by', 'bye', 'can',
             "can't", 'could', 'cannot',
             'could be', 'come',
             "couldn't", 'different', 'do', 'did', 'does', 'doing', "don't", 'done', 'down', 'either', 'ever', 'even',
             'every', 'end',
             'everyone', 'everywhere', 'easy', 'easily', 'first', 'fine', 'final', 'finally',
             'firstly', 'for', 'from', 'front', 'give', 'given', 'get', 'getting', 'goten', 'go', 'goes', 'going',
             'gonna', 'gone', 'gonnna', 'got', 'gotta', 'good', 'great', 'had',
             'has', 'have', 'his',
             'he', 'her', 'here', 'him', 'hope', 'how', 'how_about', 'how_many', 'how_much', 'however', 'have',
             'having', 'had', 'i', "i'd",
             "i'm", "i've", 'if', 'in', 'including', 'into', 'info', 'is', 'it', "it's", 'just', 'keep', 'last',
             'lastly', 'left',
             'less', 'like', 'likely', 'look',
             'lot', 'let', "let's", 'lets', 'may', 'might', 'make', 'made',
             'many', 'maybe', 'me', 'might', 'more', 'most', 'much', 'must', 'my', 'nearly', 'neither',
             'never', 'new',
             'next', 'no', 'now',
             'not', 'nothing', 'none', 'of', 'off', 'out', 'ok', 'okay', 'nobody',
             'often', 'old', 'on', 'one', 'online', 'only', 'onto', 'or', 'other', 'others', 'otherwise', 'our', 'ours',
             'over', 'please', 'put', 'rather_than', 'real', 'really', 'right', 'same', 'still', 'seem', 'soon',
             'seems', 'self', 'since',
             'she', 'should', "shouldn't", 'sorry',
             'so', 'some', 'someday', 'somehow', 'someone', 'somebody', 'something', 'sometime', 'sometimes',
             'somewhat', 'such_as',
             'such_that', 'sure', 'take', 'taking', 'took', 'taken', 'than', 'that', 'the', 'them', 'their', 'there',
             'thank', "there're",
             'there_are', 'try', 'trying', 'together', 'today', 'thses', 'those', 'then', 'they', "they're"
                                                                                                  'therefore', 'these',
             'this', 'though', 'thus', 'till', 'to', 'too', 'took', 'total', 'totally', 'under',
             'unless', 'until',
             'up', 'us', 'usual', 'usually', 'url__token', '[url_token]', 'very', 'want', 'wanna', 'was', 'we', 'went',
             'well', 'were',
             'what', "what's",
             'when', 'where',
             'whether', 'while', 'whole', 'who', 'whose', 'which',
             'why', 'will', 'wish', 'with', 'without', "won't", 'would', 'would be', 'yes', 'yet', 'you', 'your',
             'yours', 'yeah']
# --------------------------------------------------------------------------------------------------------------------
drugseed_bert_ids = {'alprazolam': 30523, 'amphetamine': 30524, 'cocaine': 16034, 'ecstasy': 19069, 'ghb': 30525,
                     'heroin': 19690, 'hydrocodone': 30526, 'ketamine': 30527, 'lsd': 30528, 'marijuana': 16204,
                     'marijuana_concentrates': 30529, 'mescaline': 30530, 'methamphetamine': 30531,
                     'methylphenidate': 30532, 'opium': 21075, 'oxycodone': 30533, 'pcp': 30534, 'percocet': 30535,
                     'promethazine': 30536, 'psilocybin_mushrooms': 30537, 'steroids': 30538,
                     'synthetic_cathinones': 30539}

drug_names_bert_ids = {'thc': 30523, 'xtc': 30524, 'ecstasy': 19069, 'morphine': 30525, 'benzos': 30526,
                       'methylphenidate': 30527, 'cbd': 30528, 'promethazine': 30529, 'suboxone': 30530,
                       'maui_wowie': 30531, 'xanies': 30532, 'percocet': 30533, 'shwag': 30534, 'bhang': 30535,
                       'heroin': 19690, 'hydrocodone': 30536, 'thca': 30537, 'flunitrazepam': 30538, 'opium': 21075,
                       'psilocybin_mushrooms': 30539, 'marijuana': 16204, 'cbd_oil': 30540, 'weed': 17901,
                       'cocaine': 16034, 'crack_cocaine': 30541, 'ditch_weed': 30542, 'mescaline': 30543,
                       'cannabis': 17985, 'edibles': 30544, 'bho': 30545, 'terpenes': 30546,
                       'synthetic_cathinones': 30547, 'shrooms': 30548, 'pcp': 30549, 'methamphetamine': 30550,
                       'hydromorphone': 30551, 'oxycodone': 30552, 'animal_tranquilizer': 30553, 'black_tar': 30554,
                       'ghb': 30555, 'menthol': 30556, 'clonazepam': 30557, 'sour_og': 30558, 'amphetamine': 30559,
                       'sizzurp': 30560, 'pingers': 30561, 'alprazolam': 30562, 'lsd': 30563, 'ketamine': 30564,
                       'marijuana_concentrates': 30565, 'steroids': 30566, 'adderall': 30567, 'xanax': 30568}
# ----------------------------------------------------------------------------------------------------------------------
import numpy as np
import torch


def seed_all(seed_value):
    # random.seed(seed_value)  # Python
    np.random.seed(seed_value)  # cpu vars
    torch.manual_seed(seed_value)  # cpu vars

    if torch.cuda.is_available():
        torch.cuda.manual_seed_all(seed_value)  # gpu vars
        torch.backends.cudnn.deterministic = True  # needed
        torch.backends.cudnn.benchmark = True
